#include <string.h>
#define BUFFER 256

char getOption(char **argv, int argc, int arg_index, char **temp){
    char c = argv[arg_index][1];
    char *opt_arg;
    if( (arg_index+1 < argc) && argv[arg_index+1][0] != '-'){
	opt_arg = (char*)malloc(BUFFER);
	if(opt_arg == NULL){
	    printf("Could not allocate memmory for opt_arg\n");
	    exit(EXIT_FAILURE);
	}
	strncpy(opt_arg, argv[arg_index+1], BUFFER);
	*temp = opt_arg;
    }else
	*temp = NULL;
    return(c);
}
